package com.ruoyi.iot.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.iot.mapper.IotAttendanceMachineMapper;
import com.ruoyi.iot.domain.IotAttendanceMachine;
import com.ruoyi.iot.service.IIotAttendanceMachineService;

/**
 * 考勤机Service业务层处理
 * 
 * @author 陈江灿
 * @date 2025-02-14
 */
@Service
public class IotAttendanceMachineServiceImpl implements IIotAttendanceMachineService 
{
    @Autowired
    private IotAttendanceMachineMapper iotAttendanceMachineMapper;

    /**
     * 查询考勤机
     * 
     * @param attendanceMachineId 考勤机主键
     * @return 考勤机
     */
    @Override
    public IotAttendanceMachine selectIotAttendanceMachineByAttendanceMachineId(Long attendanceMachineId)
    {
        return iotAttendanceMachineMapper.selectIotAttendanceMachineByAttendanceMachineId(attendanceMachineId);
    }

    /**
     * 查询考勤机列表
     * 
     * @param iotAttendanceMachine 考勤机
     * @return 考勤机
     */
    @Override
    public List<IotAttendanceMachine> selectIotAttendanceMachineList(IotAttendanceMachine iotAttendanceMachine)
    {
        return iotAttendanceMachineMapper.selectIotAttendanceMachineList(iotAttendanceMachine);
    }

    /**
     * 新增考勤机
     * 
     * @param iotAttendanceMachine 考勤机
     * @return 结果
     */
    @Override
    public int insertIotAttendanceMachine(IotAttendanceMachine iotAttendanceMachine)
    {
        iotAttendanceMachine.setCreateTime(DateUtils.getNowDate());
        return iotAttendanceMachineMapper.insertIotAttendanceMachine(iotAttendanceMachine);
    }

    /**
     * 修改考勤机
     * 
     * @param iotAttendanceMachine 考勤机
     * @return 结果
     */
    @Override
    public int updateIotAttendanceMachine(IotAttendanceMachine iotAttendanceMachine)
    {
        iotAttendanceMachine.setUpdateTime(DateUtils.getNowDate());
        return iotAttendanceMachineMapper.updateIotAttendanceMachine(iotAttendanceMachine);
    }

    /**
     * 批量删除考勤机
     * 
     * @param attendanceMachineIds 需要删除的考勤机主键
     * @return 结果
     */
    @Override
    public int deleteIotAttendanceMachineByAttendanceMachineIds(Long[] attendanceMachineIds)
    {
        return iotAttendanceMachineMapper.deleteIotAttendanceMachineByAttendanceMachineIds(attendanceMachineIds);
    }

    /**
     * 删除考勤机信息
     * 
     * @param attendanceMachineId 考勤机主键
     * @return 结果
     */
    @Override
    public int deleteIotAttendanceMachineByAttendanceMachineId(Long attendanceMachineId)
    {
        return iotAttendanceMachineMapper.deleteIotAttendanceMachineByAttendanceMachineId(attendanceMachineId);
    }
}
